﻿
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
public partial class Usercontrol_ControlQA : System.Web.UI.UserControl
{
    // For generating random numbers.
    private Random random = new Random();
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["CaptchaImageText"] = GenerateRandomCode();
    }
    private string GenerateRandomCode()
    {
        string s = "";
        for (int i = 0; i < 6; i++)
        {
            s = String.Concat(s, random.Next(10).ToString());
        }
        return s;
    }
}